fix: stop analyze.sh from hanging at interactive prompts - #15
Merged
Conversation
The installer ran the compiled binary with `< /dev/tty` to give piped `curl ... | bash` invocations a terminal. But a `bun build --compile`'d binary can't read raw-mode keypresses from a freshly-opened /dev/tty fd, so every interactive prompt hung with no way to type, arrow, or Ctrl-C out — even for the recommended `bash -c "$(curl ...)"` form, whose stdin was already a working terminal before the redirect replaced it. Run with inherited stdin instead. The command-substitution form keeps a real terminal on stdin and works; the piped form now fails the CLI's TTY gate with a clear 'requires a terminal' message (exit 2) instead of hanging.
blimmer
marked this pull request as ready for review
May 27, 2026 14:01
blimmer
pushed a commit
that referenced
this pull request
May 27, 2026
🤖 I have created a release *beep* *boop* --- ## [0.1.1](v0.1.0...v0.1.1) (2026-05-27) ### Bug Fixes * stop analyze.sh from hanging at interactive prompts ([#15](#15)) ([e894145](e894145)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: contextbridge-pr-automation[bot] <259134118+contextbridge-pr-automation[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
analyze.shinstaller ran the downloaded binary with< /dev/ttyto hand pipedcurl ... | bashinvocations a terminal. But abun build --compile'd binary cannot read raw-mode keypresses from a freshly-opened/dev/ttyfd, so every interactive prompt hung with no way to type, use arrows, or Ctrl-C out — even for the recommendedbash -c "$(curl ...)"form, whose stdin was already a working terminal until the redirect replaced it. This drops the redirect and runs with inherited stdin: the command-substitution form works, and the piped form now fails the CLI's TTY gate with a clear "requires a terminal" message (exit 2) instead of hanging.Review focus
The trade-off worth scrutinizing: this gives up on supporting
curl ... | bashentirely. Reconnecting/dev/ttyis the only mechanism to give a piped invocation a terminal, and it's exactly what's broken under the compiled Bun binary — so there's no fix that keeps the pipe form interactive. Reproduced under a real pseudo-terminal against the v0.1.0 binary: inherited stdin → Ctrl-C cancels cleanly;< /dev/tty→ prompts dead, process must be SIGKILL'd.Commits
c960e3f— drop the/dev/ttyredirect; run with inherited stdin and let the TTY gate handle non-terminals